package com.xdwanj.dao;

import com.xdwanj.pojo.Pet;
import com.xdwanj.pojo.User;
import com.xdwanj.util.PageBean;

public interface UserDao {
    /**
     * 查询所有用户
     *
     * @return
     * @throws Exception
     */
    PageBean<User> findAll(int pageSize, int currentPageNo) throws Exception;

    /**
     * 根据姓名进行模糊查询
     *
     * @param name
     * @return
     * @throws Exception
     */
    PageBean<User> findUserListByName(String name, int pageSize, int currentPageNo) throws Exception;

    /**
     * 根据用户名精准查询
     *
     * @param name
     * @return
     * @throws Exception
     */
    User findUserByName(String name) throws Exception;

    /**
     * 用户登录
     *
     * @param userName
     * @return
     * @throws Exception
     */
    User findUserByUserNameAndPassword(String userName, String password) throws Exception;

    /**
     * 注册
     *
     * @param user
     * @return
     * @throws Exception
     */
    int addUser(User user) throws Exception;

    /**
     * 添加用户所有信息
     *
     * @param user
     * @return
     * @throws Exception
     */
    int addUserAll(User user) throws Exception;

    /**
     * 更新用户
     *
     * @param user
     * @return
     * @throws Exception
     */
    int updateUser(User user) throws Exception;

    /**
     * 更新密码
     *
     * @param id
     * @param NewPassword
     * @return
     * @throws Exception
     */
    int updatePassWord(int id, String NewPassword) throws Exception;

    /**
     * 删除用户
     *
     * @param id
     * @return
     * @throws Exception
     */
    int deleteUser(int id) throws Exception;

    /**
     * 根据用户主键查宠物列表
     *
     * @param id            用户主键
     * @param pageSize      页面大小
     * @param currentPageNo 当前页码
     * @return 宠物列表
     * @throws Exception
     */
    PageBean<Pet> findPetListById(int id, int pageSize, int currentPageNo) throws Exception;

    /**
     * 用户登录
     *
     * @param id
     * @return
     * @throws Exception
     */
    User findUserById(int id) throws Exception;


}
